package com.hbjycl.entity;

import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Transient;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 教师
 * 
 * @author cl
 *
 * @datetime 2015年4月8日
 */
@Entity
public class Teacher extends BaseEntity 
{
    private static final long     serialVersionUID = -74583694645076L;
    private String                username;                                // 用户名
    private String                password;                                // 密码
    private String                mobile;                                  // 手机
    private String                email;                                   // E-mail
    private String                name;                                    // 姓名
    private Boolean               isAccountEnabled;                        // 账号是否启用
    private Boolean               isAccountLocked;                         // 账号是否锁定
    private Boolean               isAccountExpired;                        // 账号是否过期
    private Integer               loginFailureCount;                       // 连续登录失败的次数
    private Date                  lockedDate;                              // 账号锁定日期
    private Date                  loginDate;                               // 最后登录日期
    private String                loginIp;                                 // 最后登录IP
    
    @Column(updatable = false, nullable = false, unique = true)
    public String getUsername()
    {
        return username;
    }
    
    @Column(nullable = false)
    public String getPassword()
    {
        return password;
    }
   
    @Column(nullable = false)
    public String getEmail()
    {
        return email;
    }
    
    public void setEmail(String email)
    {
        this.email = email;
    }
    
    public String getName()
    {
        return name;
    }
    
    public void setName(String name)
    {
        this.name = name;
    }
    
    @Column(nullable = false)
    public Boolean getIsAccountLocked()
    {
        return isAccountLocked;
    }
    
    public void setIsAccountLocked(Boolean isAccountLocked)
    {
        this.isAccountLocked = isAccountLocked;
    }
    
    @Column(nullable = false)
    public Integer getLoginFailureCount()
    {
        return loginFailureCount;
    }
    
    public void setLoginFailureCount(Integer loginFailureCount)
    {
        this.loginFailureCount = loginFailureCount;
    }
    
    public Date getLockedDate()
    {
        return lockedDate;
    }
    
    public void setLockedDate(Date lockedDate)
    {
        this.lockedDate = lockedDate;
    }
    
    public Date getLoginDate()
    {
        return loginDate;
    }
    
    public void setLoginDate(Date loginDate)
    {
        this.loginDate = loginDate;
    }
    
    public String getLoginIp()
    {
        return loginIp;
    }
    
    public void setLoginIp(String loginIp)
    {
        this.loginIp = loginIp;
    }
    
    public void setUsername(String username)
    {
        this.username = username;
    }
    
    public void setPassword(String password)
    {
        this.password = password;
    }
    
    
    public String getMobile()
    {
        return mobile;
    }
    
    public void setMobile(String mobile)
    {
        this.mobile = mobile;
    }
    @Column(nullable = false)
    public Boolean getIsAccountEnabled()
    {
        return isAccountEnabled;
    }
    
    public void setIsAccountEnabled(Boolean isAccountEnabled)
    {
        this.isAccountEnabled = isAccountEnabled;
    }
    @Column(nullable = false)
    public Boolean getIsAccountExpired()
    {
        return isAccountExpired;
    }
    
    public void setIsAccountExpired(Boolean isAccountExpired)
    {
        this.isAccountExpired = isAccountExpired;
    }
    
}
